package dongbai.soft.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import dongbai.soft.utils.getUUID;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;
import java.util.Map;

/**
 * @author SingDeer
 * @email
 * @date 2023-06-28 16:09:11
 */
@Data
@TableName("deliverer")
@AllArgsConstructor
@NoArgsConstructor
public class DelivererEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 配送员唯一标识符
     */
    @TableId
    private String did;
    /**
     * 配送员姓名
     */
    private String name;
    /**
     * 性别（0女1男）
     */
    private Boolean gender;
    /**
     * 联系电话
     */
    private String phone;
    /**
     * 入职时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date startDate = new Date();
    /**
     * 配送总单数
     */
    private Integer sum = 0;
    /**
     * 0离职1正常
     */
    private Boolean status = true;
    /**
     * 分站ID
     */
    private String trid;

    public DelivererEntity(Map<String, Object> maps) {
        this.did = getUUID.get6UUID();
        this.gender = (Boolean) maps.get("gender");
        this.name = (String) maps.get("name");
        this.phone = (String) maps.get("phone");
        this.trid = (String) maps.get("TRID");

    }

}
